package com.founder.gateway;

import com.founder.oauth.EnableOAuthServer;
import org.setu.framework.core.properties.SetuSystemUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.ImportResource;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import com.founder.gateway.system.bean.SetuSession;
/**
 * 
 * @author: hfl 
 * @date:   2018年6月27日 下午2:52:57
 */
@SpringBootApplication
@ImportResource({"classpath:applicationContext-all.xml"})
@EnableAspectJAutoProxy (exposeProxy = true)
@EnableTransactionManagement
@Component
@EnableOAuthServer
public class Application 
{
    public static void main( String[] args )
    {
    	if(args != null && args.length>0) {
    		for(String arg:args) {
    			if(arg.startsWith("setuFilePath:")) {
    				String setuFilePath = arg.substring(13);
    				SetuSystemUtil.setuFilePath = setuFilePath;
    				System.out.println("使用外部配置文件："+setuFilePath);
    			}
    		}
    	}
    	
    	
    	SetuSystemUtil.applicationName="founder_gateway";
    	SetuSystemUtil.sessionBeanClazz=SetuSession.class;
        SpringApplication.run(Application.class, args);
    }

}